

% A short script that recovers zeta and v from data

% Sbar function
Sbar = @(zzeta) Params.tau ./ ( zzeta - 1 ) ./ ( Params.tau + zzeta ) ;
    
% recover zeta and adjust EU rate accordingly
zeta = max( st / Params.delta , 1.1 ) ;
st = zeta * Params.delta ;

zeta = st / Params.delta ;
Ez = Params.zl0 ./ Params.rho .* Params.kappa .* zeta ./ ( zeta - 1 ) ./ ( Params.kappa - 1 ) ;

% Full definition
v =    Params.b * Params.beta / Params.rho * f .* Sbar(zeta) ...
    .* ( 1 + Params.beta / Params.rho * f .* Sbar(zeta) ) ;

bpv = Params.b + v ; 